{% extends"dish/dish_index.html" %}
{% block title %}
    修改菜的信息
{% endblock %}
{% block aside %}
    {{ super() }}
{% endblock %}

{% block content %}
    <ol class="breadcrumb">
          <li><a href="#">首页</a></li>
          <li><a href="#">菜管理</a></li>
          <li class="active">修改菜信息</li>
    </ol>

    <form class="form-horizontal" method="POST" action="{{ url_for("dish.show_update_dish",dish_no=dish.dish_no) }}">
      <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">菜名</label>
        <div class="col-sm-10">
          <input type="text" class="form-control" id="inputEmail3" name="dish_name" value="{{ dish.dish_name }}">
        </div>
      </div>
      <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">price</label>
        <div class="col-sm-10">
          <input type="number" class="form-control" name="price" id="inputPassword3" value="{{ dish.price }}">
        </div>
      </div>
      <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">菜品</label>
        <div class="col-sm-10">
            <label>
                <select  class="form-control" name="dish_type_no">
                    {% for dish_type in dish_types %}
                        {% if dish.dish_type_no == dish_type.dish_type_no %}
                            <option value="{{ dish.dish_type_no }}" selected>{{ dish_type.dish_type_name }}</option>
                        {% endif %}
                            <option value="{{ dish.dish_type_no }}">{{ dish_type.dish_type_name }}</option>
                    {% endfor %}
              </select>
            </label>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-default">修改</button>
        </div>
      </div>
    </form>
    <ul>
        {% for error in get_flashed_messages() %}
            <li>{{ error }}</li>
        {% endfor %}
    </ul>
{% endblock %}